Skip to content

feat: Allow hard-coded redirect URL#9

Merged
jpage-godaddy merged 2 commits into
mainfrom
customizable-redirect-url
May 29, 2026
Merged

feat: Allow hard-coded redirect URL#9
jpage-godaddy merged 2 commits into
mainfrom
customizable-redirect-url

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented May 29, 2026

Copy link
Copy Markdown
Collaborator

The external CLI's OAuth clients are configured to only allow callback URLs that contain a specific port & "localhost" (not 127.0.0.1) as the hostname. Allow that to be specified to avoid the OAuth webpage showing a 403 error.

#authz-support thread for context.

The external CLI's OAuth clients are configured to only allow callback URLs that contain a specific port & "localhost" (not 127.0.0.1) as the hostname. Allow that to be specified.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional with_redirect_uri builder to PkceAuthProvider so the OAuth redirect_uri sent to the authorization server (and used during code exchange) can be overridden — e.g., to use http://localhost:{port}/callback for OAuth clients that allowlist localhost instead of 127.0.0.1. The local callback listener still binds to 127.0.0.1; only the port and callback path are derived from the configured URI, and wait_for_callback now validates the request path against the configured callback path.

Changes:

  • New redirect_uri: Option<String> field with with_redirect_uri builder, plus effective_redirect_uri/parse_redirect_uri helpers used in both run_pkce_flow and exchange_code_for_token.
  • wait_for_callback takes an expected_path argument and returns 404 for non-matching paths, with a new extract_request_path helper.
  • Unit tests covering default URI, override behavior, port/path parsing, and request path extraction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jpage-godaddy
jpage-godaddy merged commit e24dc24 into main May 29, 2026
3 checks passed
@jpage-godaddy
jpage-godaddy deleted the customizable-redirect-url branch May 29, 2026 18:08
jpage-godaddy pushed a commit that referenced this pull request Jun 1, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.1.2](cli-engine-v0.1.1...cli-engine-v0.1.2)
(2026-06-01)


### Features

* Allow hard-coded redirect URL
([#9](#9))
([e24dc24](e24dc24))
* Fix keychain issues and add fs fallback
([#10](#10))
([853a98a](853a98a))


### Bug Fixes

* Allow Ctrl+C to work while waiting on OAuth flow
([#7](#7))
([2b6d10e](2b6d10e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants